Conditions | 3 |
Paths | 3 |
Total Lines | 29 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | /** |
||
4 | */ |
||
5 | Amarkal.settings.search = { |
||
|
|||
6 | $fields: null, |
||
7 | $input: null, |
||
8 | init: function() { |
||
9 | var _this = this; |
||
10 | this.$fields = $('.amarkal-settings-field'); |
||
11 | this.$input = $('#settings-search'); |
||
12 | this.$input.on('keyup',function(){_this.onKeyup();}); |
||
13 | }, |
||
14 | onKeyup: function(e) { |
||
15 | var query = this.$input.val().toLowerCase(), |
||
16 | $matches; |
||
17 | |||
18 | // The user's search query is longer than 1 character |
||
19 | if(query.length > 1) { |
||
20 | |||
21 | $matches = this.find(query); |
||
22 | |||
23 | this.$fields.hide(); |
||
24 | $matches.show(); |
||
25 | |||
26 | // Textual user feedback |
||
27 | $('#settings-search-results').text($matches.length ? $matches.length+' settings found' : 'Nothing found'); |
||
28 | } |
||
29 | |||
30 | // The user's search query is not longer than 1 character |
||
31 | else { |
||
32 | this.$fields.show(); |
||
33 | $('#settings-search-results').text(''); |
||
53 | }; |
This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.
To learn more about declaring variables in Javascript, see the MDN.